<!DOCTYPE html>
<html lang="zh">
<head>
  <meta charset="UTF-8">
  <title>KG RAG Demo</title>
  <link rel="stylesheet" href="style.css" />
  <script src="https://d3js.org/d3.v7.min.js"></script>
  <script defer src="app.js"></script>
</head>
<body>
  <div class="container">
    <h1>🔍 基于知识图谱的 RAG Demo</h1>

    <label>📁 选择文件（可多选）</label>
    <input type="file" id="file" multiple accept=".txt,.csv,.json,.md,.pdf,.doc,.docx">
    <div class="file-formats">支持格式: TXT, CSV, JSON, MD, PDF, DOC, DOCX</div>

    <label>💬 询问模型</label>
    <input type="text" id="question" placeholder="请输入问题">
    <button id="submit">提交</button>

    <div id="error" class="error"></div>
    <div id="uploadList"></div>

    <div id="result" style="display:none;">
      <h2>🤖 回答</h2>
      <div id="answer"></div>
    </div>

    <div id="chatHistory"></div>

    <h3>📊 知识图谱</h3>
    <svg id="kgGraph" width="800" height="450" style="background:#111;"></svg>
  </div>
</body>
</html>
